import Vue from 'vue'
import VueRouter from 'vue-router'

// const color=r=>

Vue.use(VueRouter);
// 采用懒加载方式
const router=[
      {path:'/', redirect:'/index'},
      {path:'/index', component: ()=>import('@/components/index')},
      {path:'/tiktok', component:()=>import('@/components/tiktok')},
      {path:'/file', component: ()=>import('@/components/file')},
      {path:'/comment', component: ()=>import('@/components/comment')},
      {path:'/music', component: ()=>import('@/components/music')},
      {path:'/admin', name:'Admin', component: r => require.ensure([], () => r(require('@/components/admin')), 'admin')},
      {path:'/qrcode', component: ()=>import('@/components/qrcode')},
      {path:'/qschool', component: ()=>import('@/components/qschool')},
      {path:'/browser', component: ()=>import('@/components/browser')},
      // {path:'/color', component: ()=>import('@/components/color')},
      {path:'/color',name:'Color', component: r => require.ensure([], () => r(require('@/components/color')), 'color')},
];

// 路由对象
export default new VueRouter({
      mode:'history',
      routes: router
});
